<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<div>
	<s:if test="account==null">
		<a href="<%=request.getContextPath()%>/viewLogin.do">登录</a>后才能参与订单联购或招标，查看订单详细信息！
		<br/>如果还没有账号，可以先<a href="<%=request.getContextPath()%>/usercenter/register.do">注册</a>！
	</s:if>
	<s:if test="%{#order.isSaved()}">
		<input type="button" class="btn_blue_2" onclick="javascript:changeStatus('<s:property value="#order.id"/>');" value="邀请" />
		<br />
		<input type="button" class="btn_blue_2" onclick="javascript:deleteOrder('<s:property value="#order.id"/>');" value="删除" />
		<br />
		<input type="button" class="btn_blue_2" onclick="javascript:editOrder('<s:property value="#order.id"/>');" value="编辑" />
	</s:if>
	<!-- 当订单状态为邀请中时 -->
	<s:elseif test="%{#order.isInviting() }">
		<s:if test="canJoinAsCustomer(#order.id)">
			<input type="button" class="btn_blue_3" onclick="javascript:selectProduct('<s:property value="#order.id"/>');" value="<s:if test="orderCustomer==null">客户加入</s:if><s:else>添加需求</s:else>" />
		</s:if>
		<s:if test="canJoinAsVendor(#order.id)">
			<input type="button" class="btn_blue_3" onclick="javascript:joinAsVendor('<s:property value="#order.id"/>');" value="供应商加入" />
		</s:if>
		<s:if test="#order.isOrderManager(currentUser)">
			<input type="button" class="btn_blue_3" onclick="javascript:changeOrderStatus('<s:property value="#order.id"/>');" value="停止邀请" />
		</s:if>
	</s:elseif>
	<!-- 当订单状态为报价中时 -->
	<s:elseif test="%{ #order.isQuoting() }">
		<s:if test="#order.isOrderManager(currentUser)">
			<input type="button" class="btn_blue_3" onclick="javascript:changeOrderStatus('<s:property value="#order.id"/>');" value="停止报价" />
		</s:if>
		<s:if test="canJoinAsVendor(#order.id)">
			<input type="button" class="btn_blue_3" onclick="javascript:joinAsVendor('<s:property value="#order.id"/>');" value="供应商加入" />
		</s:if>
	</s:elseif>
	<!-- 当订单状态为投票中时 -->
	<s:elseif test="%{#order.isVoting()}">
		<s:if test="#order.isOrderManager(currentUser)">
			<input type="button" class="btn_blue_3" onclick="javascript:changeOrderStatus('<s:property value="#order.id"/>');" value="停止投票" />
		</s:if>
	</s:elseif>
	<!-- 当订单状态为已确认时 -->
	<s:elseif test="%{#order.status.isConfirmed()}">
		<s:if test="#order.isOrderManager(currentUser)">
			<input type="button" class="btn_blue_3" onclick="javascript:changeOrderStatus('<s:property value="#order.id"/>');" value="关闭" />
		</s:if>
	</s:elseif>
</div>